#ifndef PARTICLES_CONTAINER_H
#define PARTICLES_CONTAINER_H

#include "..\_Utils\src\DevilTexture.h"

#include "Particle.h"

struct ParticlesContainer
{
    const char* name;
    NxU32 *nbParticles;
    Particle *particlesBuffer;
    NxFluid *fluid;
    NxFluidEmitter *emitter;

    //visual
    NxVec3 particlesColor;
    float particlesColorAlpha;
    float particleSize;
    DevilTexture *particleTexture;

private:
    bool emitterPaused;

public:
    ParticlesContainer()
    {
        nbParticles = NULL;
        particlesBuffer = NULL;
        fluid = NULL;
        emitter = NULL;

        emitterPaused = false;

        particlesColor = NxVec3(1.0f, 1.0f, 1.0f);
        particlesColorAlpha = 1.0f;
        particleSize = 25.0f;
        particleTexture = NULL;
    }

    void ResetData()
    {
        nbParticles = NULL;
        particlesBuffer = NULL;
        fluid = NULL;
        emitter = NULL;

        emitterPaused = false;

        particlesColor = NxVec3(1.0f, 1.0f, 1.0f);
        particlesColorAlpha = 1.0f;
        particleSize = 25.0f;
        particleTexture = NULL;
    }

    void ToggleEmitter()
    {
        if(emitter != NULL)
        {
            emitterPaused = !emitterPaused;
            emitter->setFlag(NX_FEF_ENABLED, !emitterPaused);            
        }
    }

    void PauseEmitter(bool shouldBePaused)
    {
        emitterPaused = shouldBePaused;
    }
};

#endif //PARTICLES_CONTAINER_H
